<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  mounted() {
    // 监听自定义的 WebSocket 消息事件
    document.addEventListener('ws-message', (event) => {
      this.showNotification(event.detail);
    });
  },
  methods: {
    showNotification(message) {
      this.$notify({
        title: '系统通知',
        message: message,
        type: 'info',
        position: 'bottom-right',
        duration: 10000,
      });
    },
  }
}
</script>
